import request from '@/utils/request'

// api地址
const api = {
  commonToken:'api/common/sts/token',
  postsList:'api/posts/list',
  postsCreate: 'api/posts/create',
  postsDeleted: 'api/posts/deleted',
  postsComment: 'api/posts/comment/list',
  postsCommentCreate: 'api/posts/comment/create',
  postsCommentDeleted: 'api/posts/comment/deleted',
  courseList: 'api/course/list',
  courseDetail: 'api/course/detail',
  coursePalyer: 'api/course/player',
  courseReport: 'api/course/report',
  corseCommentList: 'api/course/comment/list',
  corseCommentCreate: 'api/course/comment/create',
  corseCommentDeleted: 'api/course/comment/deleted',

}

// 上传临时密钥
export const commonToken = (data) => {
  return request.post(api.commonToken, data)
}

// 贴子列表
export const postsList = (data) => {
  return request.post(api.postsList, data)
}

// 发布贴子
export const postsCreate = (data) => {
  return request.post(api.postsCreate, data)
}

// 帖子删除
export const postsDeleted = (data) => {
  return request.post(api.postsDeleted, data)
}

// 评论列表
export const postsComment = (data) => {
  return request.post(api.postsComment, data)
}

// 创建评论
export const postsCommentCreate = (data) => {
  return request.post(api.postsCommentCreate, data)
}

// 删除评论
export const postsCommentDeleted = (data) => {
  return request.post(api.postsCommentDeleted, data)
}

// 课程列表
export const courseList = (data) => {
  return request.post(api.courseList, data)
}

// 课程详情
export const courseDetail = (data) => {
  return request.post(api.courseDetail, data)
}

// 播放
export const coursePalyer = (data) => {
  return request.post(api.coursePalyer, data)
}

// 课程上报
export const courseReport = (data) => {
  return request.post(api.courseReport, data)
}

// 评论列表
export const corseCommentList = (data) => {
  return request.post(api.corseCommentList, data)
}

// 创建评论
export const corseCommentCreate = (data) => {
  return request.post(api.corseCommentCreate, data)
}

// 删除评论
export const corseCommentDeleted = (data) => {
  return request.post(api.corseCommentDeleted, data)
}

